Note
Go to the end to download the full example code. or to run this example in your browser via Binder
Face classification using Haar-like feature descriptor#
Haar-like feature descriptors were successfully used to implement the first real-time face detector [1]. Inspired by this application, we propose an example illustrating the extraction, selection, and classification of Haar-like features to detect faces vs. non-faces.
Notes#
This example relies on scikit-learn for feature selection and classification.
References#
from time import time
import numpy as np
import matplotlib.pyplot as plt
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
from sklearn.metrics import roc_auc_score
from skimage.data import lfw_subset
from skimage.transform import integral_image
from skimage.feature import haar_like_feature
from skimage.feature import haar_like_feature_coord
from skimage.feature import draw_haar_like_feature